Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
satoshi-bitcoin
Advanced tools
npm module to convert between Satoshi and Bitcoin with lightweight precision.
npm install --save satoshi-bitcoin
# OR
yarn add satoshi-bitcoin
var sb = require("satoshi-bitcoin");
sb.toSatoshi(1);
//=>100000000
sb.toBitcoin(100000000);
//=>1
<!-- package injected as "sb" -->
<script src="https://rawgit.com/dawsonbotsford/satoshi-bitcoin/master/index.bundle.js"></script>
<script>
console.log("One Satoshi equals " + sb.toBitcoin(1) + " Bitcoin");
</script>
Or download it with npm install --save satoshi-bitcoin
and reference it as:
<script src="node_modules/satoshi-bitcoin/index.bundle.js"></script>
try {
sb.toSatoshi(false); //Throws TypeError
} catch (err) {
console.log(err);
}
sb.toSatoshi(number || string)
sb.toBitcoin(number || string)
What is a Satoshi?
Why do I need a module when I can just divide or multiply by 100,000,000?
satoshi-bitcoin
uses a tiny bignum library (big.js) to ensure accurate conversions!npm test
MIT © Dawson Botsford
FAQs
Convert Satoshi <-> Bitcoin
The npm package satoshi-bitcoin receives a total of 1,837 weekly downloads. As such, satoshi-bitcoin popularity was classified as popular.
We found that satoshi-bitcoin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.